package papacharly.encheres.model;
// Generated 12 mars 2011 11:05:58 by Hibernate Tools 3.2.1.GA


import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Enchere generated by hbm2java
 */
@Entity
@Table(name="enchere"
    ,catalog="PAPACHARLY"
)
public class Enchere  implements java.io.Serializable {


     private Integer idEnchere;
     private Produit produit;
     private User user;
     private Date date;
     private float prix;

    public Enchere() {
    }

    public Enchere(Produit produit, User user, Date date, float prix) {
       this.produit = produit;
       this.user = user;
       this.date = date;
       this.prix = prix;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="idEnchere", unique=true, nullable=false)
    public Integer getIdEnchere() {
        return this.idEnchere;
    }
    
    public void setIdEnchere(Integer idEnchere) {
        this.idEnchere = idEnchere;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idVente", nullable=false)
    public Produit getProduit() {
        return this.produit;
    }
    
    public void setProduit(Produit produit) {
        this.produit = produit;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idEncherisseur", nullable=false)
    public User getUser() {
        return this.user;
    }
    
    public void setUser(User user) {
        this.user = user;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="date", nullable=false, length=19)
    public Date getDate() {
        return this.date;
    }
    
    public void setDate(Date date) {
        this.date = date;
    }
    
    @Column(name="prix", nullable=false, precision=12, scale=0)
    public float getPrix() {
        return this.prix;
    }
    
    public void setPrix(float prix) {
        this.prix = prix;
    }




}


